package com.jf.design.chain;

import lombok.Data;

/**
 * @author Yunfeng
 */
@Data
public abstract class AbstractHandler {

    private AbstractHandler nextHandler;

    /**
     * 链子方法
     */
    public void chain() {
        doChina();
        if (null != getNextHandler()) {
            getNextHandler().chain();
        }
    }

    /**
     * 具体环节出来逻辑
     */
    abstract void doChina();

}
